<template>
    <div id="app">
        <router-view class="view"/>
        <div v-if="mobile" class="advice">
            <img src='../public/img/QRcode.png' alt="">
        </div>
    </div>
</template>
<script lang="ts">
    import Vue from 'vue'
    import {Component} from 'vue-property-decorator'

    @Component
    export default class App extends Vue{
        mobile = false;
        mounted(){
            if(document.documentElement.clientWidth > 500){
                this.mobile = true;
                alert('请使用手机预览')

            }
        }
    }
</script>
<style lang="scss">
    @import "~@/assets/style/helper.scss";
    @import "~@/assets/style/reset.scss";

    #app {
        font-family: Avenir, Helvetica, Arial, sans-serif;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-align: center;
        color: #2c3e50;
        background: #f5f5f5;
    }

    .view {
        /*border: 1px solid red;*/
    }

    #nav {
        padding: 30px;

        a {
            font-weight: bold;
            color: #2c3e50;

            &.router-link-exact-active {
                color: #42b983;
            }
        }
    }
    .advice{
        display: flex;
        justify-content: center;
        align-items: center;
        position: fixed;
        top: 0;right: 0;bottom: 0;left: 0;
        margin: auto;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.75);
        > img{
            width: auto;
            height: 50%;
        }
    }
</style>
